<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateItinerarioRuta extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('itinerario_ruta', function (Blueprint $table) {
            $table->increments('id_itinerarioruta');
            $table->integer('id_ruta');
            $table->integer('id_itinerario');

            //            $table->primary('id_itinerarioruta');
            $table->foreign('id_ruta')->references('id_ruta')->on('ruta');
            $table->foreign('id_itinerario')->references('id_itinerario')->on('itinerario');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('itinerario_ruta');
    }
}
